/**
 * author: wancheng
 * date: 2018/08/1
 * des: 考勤管理-休假申请-待我审批
 */
import request from '@/utils/request'

export function getVacationApplyList(status) {
  return request({
    url: '/hr/attendancemanager/getVacationApplyListA/mock',
    method: 'get'
  })
}



export function addVacationApply(data) {
  return request({
    url: '/hr/attendancemanager/addVacationApply/mock',
    method: 'post',
    data
  })
}


/**
 * 外出申请，查询详情页面
 *
 * @param {} data
 */
export function findDetail(id) {
  return request({
    url: '/hr/attendancemanager/findDetail/mock',
    method: 'post'
  })
}


export function getOutsideApplyList(status) {
  return request({
    url: '/hr/attendancemanager/getOutsideApplyListA/mock',
    method: 'get'
  })
}

/**
 * 1. 获取休假申请 list
 */
export function findVacationIngApi(params) {
  if (!params.status) {
    params.status = '1'
  }
  return request({
    url: '/attendanceverifys/findVacationIng',
    method: 'get',
    params: params
  })
}


/**
 * 2. 获取出行申请 list
 */
export function findOutsideIngApi(params) {
  if (!params.status) {
    params.status = '1'
  }
  return request({
    url: '/attendanceverifys/findOutsideIng',
    method: 'get',
    params: params
  })
}

/**
 * 2.2 获取报销申请 list
 */
export function findReimburseIngApi(params) {
  if (!params.status) {
    params.status = '1'
  }
  return request({
    url: '/attendanceverifys/findReimburseIng',
    method: 'get',
    params: params
  })
}


/**
 * 3. 获取状态统计 findStatusCount
 */
export function findStatusCountApi(params) {
  return request({
    url: '/attendanceverifys/findStatusCount',
    method: 'get',
    params: params
  })
}

/**
 * 4. 休假申请退回或者通过 1通过， 0 退回
 */
export function dealVacationApi(params) {
  return request({
    url: '/attendanceverifys/dealVacation',
    method: 'post',
    params: params
  })
}

/**
 * 5. 出行申请退回 或者通过 1通过， 0 退回
 */
export function outsideBackApi(data) {
  return request({
    url: '/attendanceverifys/dealOutside',
    method: 'post',
    data
  })
}

/**
 * 6. 报销申请退回 或者通过 1通过， 0 退回
 */
export function reimburseBackApi(data) {
  return request({
    url: '/attendanceverifys/dealReimburse',
    method: 'post',
    data
  })
}

/**
 * get 获取单条出行信息
 * @param {*} params
 */
export function getOutSideDataApi(id) {
  return request({
    url: '/attendanceoutsides/outsideDetail/' + id + '/1',
    method: 'get'
  })
}


/**
 * get 拜访获取报销出行信息
 * @param {*} params
 */
export function getCostDataApi(id) {
  return request({
    url: '/attendanceoutsides/costDetail/' + id + '/2',
    method: 'get'
  })
}
/**
 * 出行获取详情
 * @param {*} id
 */

export function getCostData(id) {
  return request({
    url: '/attendanceoutsides/costDetail/' + id + '/1',
    method: 'get'
  })
}



// findVisitList,findReimbursementList
/**
 * 拜访客户的 list
 */
export function findVisitList(params) {
  if (!params.status) {
    params.status = '1'
  }
  return request({
    url: '/attendanceverifys/findOutsideIng',
    method: 'get',
    params: params
  })
}

/**
 * 拜访客户报销的 list
 */
export function findReimbursementList(params) {
  if (!params.status) {
    params.status = '1'
  }
  return request({
    url: '/attendanceverifys/findReimburseIng',
    method: 'get',
    params: params
  })
}



/**
 * get 获取拜访客户的详情
 * @param {*} params
 */
export function getVisitDetail(id) {
  return request({
    url: '/attendanceoutsides/outsideDetail/' + id + '/2',
    method: 'get'
  })
}
